package Graph;

import lombok.Data;

import java.util.Objects;

/**
 * @author ZAY
 * 图的顶点类定义
 */
@Data
public class Vertex {
    /**
     * 顶点名称
     */
    private String vertexName;
    public Vertex(String vertexName){
        this.vertexName = vertexName;
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Vertex vertex = (Vertex) o;
        return Objects.equals(vertexName, vertex.vertexName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(vertexName);
    }
}
